<?php

namespace oneStep\Controllers;

use oneStep\Response;

class Controller
{
    /**
     * @param $name
     * @param null $defaultValue
     * @return mixed|null
     */
    public function input($name, $defaultValue = null)
    {
        return $_REQUEST[$name] ?? $defaultValue;
    }

    /**
     * 
     * @return bool
     */
    public function isPost()
    {
        $method = $_SERVER['REQUEST_METHOD'];
        return $method == 'POST' ? true : false;
    }

    public function headers($name)
    {
        return getHeaders()[$name] ?? '';
    }


}